<!DOCTYPE HTML>
<html>
<head>
<style>
#autosize {
  font-size: 10px;
}
</style>
<script src="resources/autosizingTest.js"></script>
<script>
  function test() {
    var fontSizeOriginal = getAutosizedFontSize();
    setWindowSizeOverride(520, 480);
    var fontSizeUpdated = getAutosizedFontSize();

    if (fontSizeOriginal != fontSizeUpdated)
      document.write('PASS');
    else
      document.write('FAIL. Expected font size to change but it stayed at ' + fontSizeOriginal);
    if (window.testRunner)
      testRunner.dumpAsText();
  }

  function getAutosizedFontSize() {
    var autosizeContainer = document.getElementById('autosize');
    var forceLayout = autosizeContainer.offsetWidth;
    return parseInt(window.getComputedStyle(autosizeContainer).fontSize);
  }
</script>
</head>
<body onload="test()">
  <div id="autosize">
    This test passes if this text changes size due to autosizing after a dynamic window size change occurs. I'm just adding lines so this text is long enough to autosize. I'm just adding lines so this text is long enough to autosize. I'm just adding lines so this text is long enough to autosize. I'm just adding lines so this text is long enough to autosize. I'm just adding lines so this text is long enough to autosize. I'm just adding lines so this text is long enough to autosize. 
  </div>
</body>
</html>
